Promise.MyAny = function(arr) {
    let count = 0
    let res = []
    return new Promise((resolve, reject) => {
        arr.forEach(item => {
            Promise.resolve(item).then(res => {
                resolve(res)
               
            })
            .catch(err => {
                res.push({status:'rejected', value:err})
                count++
                if(count == arr.length) {
                    reject(res)
                }
            })
           
        })
    })
}

let a = new Promise((resolve, reject) => {
    resolve('a')
})
let b = new Promise((resolve, reject) => {
    reject('b')
})
let c = new Promise((resolve, reject) => {
    reject('c')
})

Promise.MyAny([a,b,c]).then(res => console.log(res), err => console.log(err))

// var resolved = Promise.reject(42);
// var rejected = Promise.reject(-1);
// var alsoRejected = Promise.reject(Infinity);

// Promise.any([resolved, rejected, alsoRejected]).then(function (result) {
//   console.log(result); // 42
// });

// Promise.any([a, b, c]).then(res => console.log(res))
// console.log(test);